The Database API > Database API functions > MMDB.getConnectionName() |
![]() ![]() ![]() |
Availability
Dreamweaver UltraDev 1.0
Description
Gets the connection name corresponding to the specified connection string. This function is useful when you need to reselect a connection name in the user interface from data on the page.
If you have a connection string that references two different drivers, you can specify both the connection string and the driver that corresponds to the connection name you want returned. For example, you could have two connections:
Connection1 has the following properties:
ConnectionString="jdbc:inetdae:velcro-qa-5:1433?database=pubs" DriverName="com.inet.tds.TdsDriver"
Connection2 has the following properties:
ConnectionString="jdbc:inetdae:velcro-qa-5:1433?database=pubs" DriverName="com.inet.tds.TdsDriver2"
The connection strings for both Connection1 and Connection2 are the same. Connection2 connects to a more recent version of TdsDriver
. You should pass the driver name to this function to fully qualify the connection name you would like returned.
Arguments
connString
, {driverName}
![]() |
connString is the connection string used to get the connection name. |
![]() |
driverName is an optional argument that further qualifies connString . |
Returns
A connection name string corresponding to the connection string.
Example
The following code returns the string "EmpDB"
:
var connectionName = MMDB.getConnectionName ¬ ("dsn=EmpDB;uid=;pwd=");
![]() ![]() ![]() |